package com.mf.springcloud.controller;

import com.mf.springcloud.entity.Article;
import com.mf.springcloud.service.ArticleClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ArticleController {

    private ArticleClientService service;

    @RequestMapping(value="/feign/article/add")//consumer/article/add
    public boolean add(Article article){
        return service.add(article);
    }

    @RequestMapping(value="/feign/article/get/{id}")//consumer/article/get/{id}
    public Article get(@PathVariable("id") Integer id){
        return service.get(id);
    }
}
